package com.htfyun.hardware;

import android.hardware.htfyun.IHTFrameworksHelperService;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

import com.htfyun.hardware.reflect.Utils;

import java.util.List;


public class HTFrameworksHelperController {
    private static final String TAG = "HTFrameworksHelper";

    private static HTFrameworksHelperController sInstance = null;
    private IHTFrameworksHelperService mService = null;


    private HTFrameworksHelperController() {
        IBinder binder = Utils.getSystemServiceReflect("HTFrameworksHelperService");
        if (binder == null) {
            Log.e(TAG, "Could not retrieve HTFrameworksHelperService");
            return;
        }
        mService = IHTFrameworksHelperService.Stub.asInterface(binder);
    }

    public static synchronized HTFrameworksHelperController getInstance() {
        if (sInstance == null) {
            sInstance = new HTFrameworksHelperController();
        }
        return sInstance;
    }

    public void updateWhiteListForNet() {
        if (mService == null) {
            return;
        }
        try {
            mService.updateWhiteListForNet();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

}
